import request from '@/utils/request'

// 上传头像文件
export function uploadAvatar(formData) {
  return request({
    url: '/api/auth/avatar/upload/',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 通过Base64上传头像
export function uploadAvatarBase64(data) {
  return request({
    url: '/api/auth/avatar/upload-base64/',
    method: 'post',
    data
  })
}

// 删除头像
export function deleteAvatar() {
  return request({
    url: '/api/auth/avatar/delete/',
    method: 'delete'
  })
}

// 获取当前用户头像
export function getAvatar() {
  return request({
    url: '/api/auth/avatar/get/',
    method: 'get'
  })
}

// 获取指定用户头像
export function getUserAvatar(userId) {
  return request({
    url: `/api/auth/avatar/get/${userId}/`,
    method: 'get'
  })
} 